package com.bobi.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.bobi.utils.StringUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.io.Serializable;

/**
 * 会员表(BobiMember)实体类
 *
 * @author makejava
 * @since 2023-07-02 16:30:09
 */
@Data
@TableName("bobi_member")
@AllArgsConstructor
@NoArgsConstructor
public class Member extends BaseEntity {
    private static final long serialVersionUID = -88779792533720119L;
    /**
     * 会员姓名
     */
    private String memName;
    /**
     * 会员手机号
     */
    private String memTelephone;
    /**
     * 会员性别，1为男，0为女
     */
    private Integer sex;
    public QueryWrapper<Member> initWrapper(Member member) {
        if(member.getId() != null || member.getMemName() != null) {
            QueryWrapper<Member> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq(StringUtils.isNotBlank(member.getId()), "id", member.getId());
            queryWrapper.eq(StringUtils.isNotBlank(member.getMemName()), "mem_name" ,member.getMemName());
            return queryWrapper;
        }
        return null;
    }
}

